
$(function() {
	// input 加入事件
	$("input[type='text']").bind('change', function() {
		//var o = this;
	});
	$("input[type='radio']").bind('change', function() {
		var o = this;
		var id = o.id;
		var selected = o.checked;
		var data = {"id":id,"selected":selected};
		requestURL(data);
	});
	$("input[type='checkbox']").bind('change', function() {
		var o = this;
		var id = o.id;
		var selected = o.checked;
		var data = {"id":id,"selected":selected};
		requestURL(data);
		var e = $(o).attr("entry");
		if(e != null && e == "entry") {
			if(selected) {
				$("input[parent="+id+"]").attr("disabled", "disabled");
			} else {
				$("input[parent="+id+"]").removeAttr("disabled");
			}
		}
	});
	function requestURL(data) {
		$.post('answer.naire', data, function(msg) {
			
		});
	}
	var entrys = $("input[entry]");
	$.each(entrys, function() {
		var o = this;
		var id = o.id;
		var selected = o.checked;
		if(selected) {
			$("input[parent="+id+"]").attr("disabled", "disabled");
		} else {
			$("input[parent="+id+"]").removeAttr("disabled");
		}
	});
});